package shuyu;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DB {
	public static String DB_URL = "jdbc:mysql://localhost:8889/mydb?useUnicode=true&characterEncoding=utf-8";
	
	public static String DB_USER = "root";
	
	public static String DB_PASSWORD = "root";
	
	public static Connection getConnection() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);
			return conn;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
}
